<template>
    <div>
        <div v-html="htmlStr" class="md-body markdown-body"></div>
    </div>
</template>

<script>
import MarkdownIt from 'markdown-it';
import Axios from 'axios';
const markdownTextFile = 'http://localhost:5173/README.md';
export default {
    name: 'markdownTest',
    data() {
        return {
            markdown: '',
            htmlStr: '# title',
        };
    },
    created() {
        this.markdown = new MarkdownIt();
		//this.htmlStr = this.markdown.render("#### title");
		
		Axios.get(markdownTextFile).then((res) => {
		    this.htmlStr = this.markdown.render(res.data);
		})
    }
}
</script>